#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

char* defangIPaddr(char* address) {
    int len = strlen(address);
    int pos = 0;
    char* res = (char*)malloc(sizeof(char) * (len + 7));
    for (int i = 0; i < len; i++) {
        if (address[i] == '.') {
            pos += sprintf(res + pos, "%s", "[.]");
        }
        else {
            res[pos++] = address[i];
        }
    }
    res[pos] = '\0';
    return res;
}


int main()
{
	return 0;
}